package com.cantierinformatici.mygym.dialogs;

import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;

import com.cantierinformatici.mygym.R;

public class DeleteDialog extends DialogFragment {

	private OnClickListener mDeleteListener;

	public DeleteDialog() {
		super();
	}

	public void setDeleteListener(OnClickListener mDeleteListener) {
		this.mDeleteListener = mDeleteListener;
	}

	@Override
	public Dialog onCreateDialog(Bundle savedInstanceState) {
		AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());

		builder.setTitle(R.string.list_item_delete_confirm);
		builder.setPositiveButton(R.string.ok, mDeleteListener);
		builder.setNegativeButton(R.string.cancel,
				new DialogInterface.OnClickListener() {
					@Override
					public void onClick(DialogInterface dialog, int id) {
						dismiss();
					}
				});
		return builder.create();
	}
}
